package operation;
import book.book;
import  book.booklist;

import java.util.Scanner;

public class return1  implements ioperation{
    public void work(booklist booklist){
        System.out.println("请输入要归还的名字");
        int i=0;
        Scanner scanner =new Scanner(System.in);
        String name =scanner.nextLine();
        int currentsize=booklist.getUsedsize();
        for(;i<currentsize;i++){
            book book=booklist.gettops(i);
            if(book.getName().equals(name)){
                book.setBorrowed(false);
                System.out.println("归还成功");
                return;
            }
            else{
                System.out.println("nofind");
            }
        }
    }
}
